package com.codez.util;

import java.util.List;
import java.util.stream.Collectors;

import com.google.common.base.Joiner;
import com.google.common.base.Splitter;

/**
 * 
 * @author 干净的代码
 * @创建时间  ： 2019-07-01
 * 
 */

public class StringUtils {

	// 1,2,3,4,,5
	public static List<Integer> split2ListInt(String str){
		List<String> splitToList = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(str);
		List<Integer> ids = splitToList.stream().map(s -> Integer.parseInt(s)).collect(Collectors.toList());
		return ids;
	}
	
	public static void main(String[] args) {
		System.out.println(split2ListInt("1,2,3,4,,3,,2"));
		System.out.println(Joiner.on("_").join(new String[]{"dsa","dsa"}));;
	}
	
}
